<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"  %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=no, email=no">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <meta name="screen-orientation" content="portrait">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>dld</title>
    <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/Swiper/3.3.1/css/swiper.min.css" rel="stylesheet">
    <style>
    html{
     height: 100%;
    }
    body {
        height: 100%;
        background: linear-gradient(rgb(204, 255, 153), rgb(204, 255, 255));
        overflow-x: hidden;
        font-family: SimSun;
        color: rgba(255, 255, 255, 0.8);
    }
    
    img.news-img {
        height: 80px;
        width: 80px;
    }
    
    p.frist-p {
        font-size: 18px;
        margin: 10px 0 0 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-right: 0;
    }
    
    p.second-p {
        font-size: 9px;
        margin: -5px 0 10px 0;
        color: rgba(255, 255, 255, 0.5);
    }
    
    .swiper-slide {
        background-color: rgb(114, 114, 114);
    }
    
    .swiper-container {
        height: 200px;
    }
    
    .swiper-slide-p {
        font-size: 27px;
        margin: 162px 0 0 0;
        padding: 0 10px;
        position: absolute;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1px;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /*暗影*/
    
    .box-shadow {
        box-shadow: 0 0 15px 3px rgba(255, 255, 255, 1);
    }
    .tab{
    	background-color: rgb(33,33,34);
    	color:rgba(255,255,255,0.8);
    	border: 1px solid rgba(255, 255, 255, .15);
    	border-radius: 0;
    }
    </style>
</head>

<body>
    <nav class="navbar navbar-top box-shadow" style="background-color: rgb(51, 51, 51);margin-bottom: 0;">
        <div class="col-xs-3" onclick="window.location.href='usersAction'">
            <span class="glyphicon glyphicon glyphicon-user pull-left" style="font-size: 18px;margin-top: 13px;"></span>
        </div>
        <div class="col-xs-6" align="center">
            <p style=";font-size: 27px;margin: 5px 0 0 0;">dld</p>
        </div>
        <div class="col-xs-3">
            <span class="glyphicon glyphicon-search pull-right" style="font-size: 18px;margin-top: 13px;"></span>
        </div>
    </nav>
    <div class="container" style="max-width:600px;padding:0;">
        <div class="swiper-container">
            <div class="swiper-wrapper">
	     		<s:iterator value="msgListAdv" status="st" var="list">
	                <div class="swiper-slide" onclick="showContent('<s:property value="#list.getContent()"/>','<s:property value="#list.getTitle()"/>','<s:property value="#list.getId()"/>')">
	                    <img src="<s:property value="#list.getImg_url()"/>" alt="" style="position: absolute;height:200px;width:100%;z-index: 0;">
	                    <p class="swiper-slide-p"><s:property value="#list.getTitle()"/></p>
	                </div>
	    		</s:iterator>
            </div>
        </div>
        <div class="text-center" style="width:100%;height:20px;background-color:rgb(56,64,63);color:rgb(255, 255, 255);">
            <span class="glyphicon glyphicon-minus" style="-webkit-transform: scaleX(5);transform: scaleX(5);-webkit-transform-origin: scaleX(5);"></span>
        </div>
        <a href="#news" aria-controls="controller" role="tab" data-toggle="tab" class="col-xs-6 btn tab">新闻</a>
        <a href="#bc" aria-controls="controller" role="tab" data-toggle="tab" class="col-xs-6 btn tab">广播</a>
        
		<div class="tab-content" style="background-color: rgba(33,33,34,.4);">
		
		  <div role="tabpanel" class="tab-pane fade in active" id="news">
	        <s:iterator value="msgListNews" status="st" var="list">
	        <div class="col-xs-12" style="background-color: rgb(51, 51, 51);margin-bottom: 1px;">
	            <div class="col-xs-10" style="padding: 0;">
	                <p class="frist-p"><s:property value="#list.getTitle()"/></p>
	                <p class="second-p">浏览：<s:property value="#list.getRead_num()"/><span class="pull-right"><s:property value="#list.getCreated_at()"/></span></p>
	            </div>
	            <div class="col-xs-2" style="padding: 0;font-size: 27px;margin-top:14px;" onclick="showContent('<s:property value="#list.getContent()"/>','<s:property value="#list.getTitle()"/>','<s:property value="#list.getId()"/>')">
	                <span class="glyphicon glyphicon-circle-arrow-right pull-right"></span>
	            </div>
	        </div>
	        </s:iterator>
		  </div>
		  <div role="tabpanel" class="tab-pane fade" id="bc">
	        <s:iterator value="msgListBc" status="st" var="list">
	        <div class="col-xs-12" style="background-color: rgb(51, 51, 51);margin-bottom: 1px;">
	            <div class="col-xs-10" style="padding: 0;">
	                <p class="frist-p"><s:property value="#list.getTitle()"/></p>
	                <p class="second-p">浏览：<s:property value="#list.getRead_num()"/><span class="pull-right"><s:property value="#list.getCreated_at()"/></span></p>
	            </div>
	            <div class="col-xs-2" style="padding: 0;font-size: 27px;margin-top:14px;" onclick="showContent('<s:property value="#list.getContent()"/>','<s:property value="#list.getTitle()"/>','<s:property value="#list.getId()"/>')">
	                <span class="glyphicon glyphicon-circle-arrow-right pull-right"></span>
	            </div>
	        </div>
	        </s:iterator>
		  </div>
	    </div>
    </div>
    <div class="show-content" style="display:none;color:rgb(51,51,51);">
    	<div class="col-xs-12 text-center"><h2 class="title"></h2></div>
    	<div class="col-xs-12 content"></div>
	    <button class="back btn btn-default col-xs-12" style="position:fixed;left:0;bottom:0;">返回</button>
    </div>
    <script src="http://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/Swiper/3.3.1/js/swiper.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <script>
    var swiper = new Swiper('.swiper-container', {
        slidesPerView: 1,
        autoplay: 3000,
        spaceBetween: 1,
        loop: true,
        onTap: function(swiper) {
            swiper.slideTo(swiper.clickedIndex);
        }
    })
    function showContent(content, title, id){
    	$('.container').toggle();
    	$('.show-content').toggle();
    	$('.content').html(content);
    	$('.title').html(title);
    	$('.content img').addClass('img-responsive');
        $.ajax({
            type: 'GET',
            url: "MsgAddReadnumAction?id=" + id,
            cache: false,
            async: true,
            success: function(data) {
            	console.log(data);
            },
            error: function() {
            }
        });
    }
    $('.back').click(function(){
    	$('.container').toggle();
    	$('.show-content').toggle();
    });
    </script>
</body>

</html>
